package com.bupt.secret.dto;
import com.sun.jna.Structure;
import lombok.Data;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import static com.bupt.secret.constant.BuptConstant.RSAREF_MAX_LEN;
/**
 * @author ShiShuMin
 * @version v1.0
 * @ClassName RSArefPublicKey
 * @Date: 2024/8/27 11:41
 * @Description: 公钥结构
 */
@Data
public class RSArefPublicKey extends Structure implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 模长,数据长度4字节
     */
    public int bits;
    /**
     * 模N，数据长度245字节
     */
    public byte[] m = new byte[RSAREF_MAX_LEN];
    /**
     * 公钥指数，数据长度245字节
     */
    public byte[] e = new byte[RSAREF_MAX_LEN];
    @Override
    protected List<String> getFieldOrder() {
        return Arrays.asList(
                "bits", "m", "e"
        );
    }
}